<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-category" data-rule="required" class="form-control selectpicker" name="row[category]">
                {foreach name="categoryList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.category"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group title-class" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <!-- classify -->
    <div class="form-group classify-class" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Classify')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-classify" data-rule="required" class="form-control" name="row[classify]">
                {foreach name="classifyList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.classify"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Structure_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-structure_id" data-rule="" data-source="newhouse/structure/index" data-params="{'custom[newhouse_id]':'{$row.newhouse_id|htmlentities}'}" data-field="title" class="form-control selectpage" name="row[structure_id]" type="text" value="{$row.structure_id|htmlentities}">
        </div>
    </div> -->
    <div class="form-group layout-class" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Layout_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-layout_id" data-rule="" data-source="newhouse/layout/index" data-params="{'custom[structure_id]':'{$row.structure_id|htmlentities}'}" data-field="title" class="form-control selectpage" name="row[layout_id]" type="text" value="{$row.layout_id|htmlentities}" placeholder="请选择">
        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-multipart={"module":"h/real"} data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="display:flex;flex-direction: row;">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="hidden" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-multipart={"module":"h/real"} data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-maxsize="500KB" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span style="margin-left: 80px;text-align:center;line-height:31px;">图片不大于500kb，支持JPG、PNG格式，图片描述不大于80字</span>
                <span class="msg-box n-right" for="c-image"></span>
            </div>

            <!--ul需要添加 data-template和data-name属性，并一一对应且唯一 -->
            <ul class="row list-inline plupload-preview" id="p-image" data-template="msgtpl" data-name="row[msg]"></ul>

            <!--请注意 ul和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[msg]" class="form-control" style="margin-top:5px;display:none;">{$row.msg|htmlentities}</textarea>
            <!--这里自定义图片预览的模板 开始-->
            <script type="text/html" id="msgtpl">
                <li class="col-xs-3">
                    <a href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail">
                        <img src="<%=fullurl%>" class="img-responsive">
                    </a>
                    <input type="text" name="row[msg][<%=index%>]" class="form-control" placeholder="请输入文件描述" value="<%=value?value:''%>" maxlength="20" />
                    <a href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a>
                </li>
            </script>
            <!--这里自定义图片预览的模板 结束-->
        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Msg')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-msg" class="form-control" name="row[msg]" type="text" value="{$row.msg|htmlentities}">
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-flag" data-rule="required" class="form-control selectpicker" name="row[flag]">
                {foreach name="flagList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.flag"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
